package com.keensense.vcm.model;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import com.keensense.vcm.model.enums.OrderEnum;
import com.keensense.vcm.model.enums.SortEnum;

/**
 * @author lanjian
 * @date 2020/5/6 8:21 下午
 */
@XmlRootElement(name = "request")
public class VehicleSearchByPhotoRequest {

    private VehicleSearchByPhotoRequest() {}

    public VehicleSearchByPhotoRequest(Long startTime, Long endTime, Picture picture, Page page) {
        this.startTime = startTime;
        this.endTime = endTime;
        this.picture = picture;
        this.page = page;
    }

    /**
     * 检索条目默认100，范围[100,1000]
     */
    @XmlElement
    private Integer count;

    /**
     * 相似度阈值，默认90,范围[1,100]
     */
    @XmlElement
    private Integer confidenceThreshold;

    /**
     * 以图检索类型，默认1，0特征检索，1属性检索
     */
    @XmlElement
    private Integer searchType;

    /**
     * 开始时间，格式为格林威治标准时间的毫秒偏移数
     */
    @XmlElement
    private Long startTime;

    /**
     * 结束时间，格式为格林威治标准时间的毫秒偏移数
     */
    @XmlElement
    private Long endTime;

    /**
     * 摄像机列表
     */
    @XmlElementWrapper(name = "cameraSns")
    @XmlElement(name = "cameraSn")
    private List<String> cameraSns;

    @XmlElementWrapper(name = "historyFileIds")
    @XmlElement(name = "historyFileId")
    private List<String> historyFileIds;

    /**
     * 域编码列表
     */
    @XmlElementWrapper(name = "domainCodes")
    @XmlElement(name = "domainCode")
    private List<String> domainCodes;

    @XmlElement
    private Picture picture;

    /**
     * 请求域等级
     */
    @XmlElement
    private String requestLevel;

    /**
     * 搜索相似车牌是否开启，-1不涉及；0无；1有
     */
    @XmlElement
    private Integer plateSimilar;

    /**
     * 副驾驶遮阳板-1代表不限 0无 1有
     */
    @XmlElement(name = "vicesunvisor")
    private Integer viceSunVisor;

    /**
     * 纸巾盒，-1：未知0：不存在 1：存在
     */
    @XmlElement(name = "napkinbox")
    private Integer napkinBox;

    /**
     * 驾驶员打手机，-1：不限0：不存在 1：存在
     */
    @XmlElement(name = "maincall")
    private Integer mainCall;

    /**
     * 抽烟 -1:不限 0：未知 1：吸烟 2：未吸烟
     */
    @XmlElement
    private Integer smoking;

    /**
     * 面部遮挡 -1：不限 0：未知 1：面部遮挡 2：无面部遮挡
     */
    @XmlElement(name = "faceshadow")
    private Integer faceShadow;

    /**
     * 副驾驶安全带，-1：不限0：不存在 1：存在
     */
    @XmlElement(name = "vicebelt")
    private Integer viceBelt;

    /**
     * 算法code编码列表。（当前仅支持传入一种算法）在单算法场景下，可以不填写。在多算法场景下，必须填写。若在多算法场景下，不写该字段，报错误码。
     */
    @XmlElementWrapper(name = "algorithms")
    @XmlElement(name = "algorithmCode")
    private List<String> algorithms;

    @XmlElement
    private Page page;

    public void setCount(Integer count) {
        this.count = count;
    }

    public void setConfidenceThreshold(Integer confidenceThreshold) {
        this.confidenceThreshold = confidenceThreshold;
    }

    public void setSearchType(Integer searchType) {
        this.searchType = searchType;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public void setCameraSns(List<String> cameraSns) {
        this.cameraSns = cameraSns;
    }

    public void setHistoryFileIds(List<String> historyFileIds) {
        this.historyFileIds = historyFileIds;
    }

    public void setDomainCodes(List<String> domainCodes) {
        this.domainCodes = domainCodes;
    }

    public void setRequestLevel(String requestLevel) {
        this.requestLevel = requestLevel;
    }

    public void setPlateSimilar(Integer plateSimilar) {
        this.plateSimilar = plateSimilar;
    }

    public void setViceSunVisor(Integer viceSunVisor) {
        this.viceSunVisor = viceSunVisor;
    }

    public void setNapkinBox(Integer napkinBox) {
        this.napkinBox = napkinBox;
    }

    public void setMainCall(Integer mainCall) {
        this.mainCall = mainCall;
    }

    public void setSmoking(Integer smoking) {
        this.smoking = smoking;
    }

    public void setFaceShadow(Integer faceShadow) {
        this.faceShadow = faceShadow;
    }

    public void setViceBelt(Integer viceBelt) {
        this.viceBelt = viceBelt;
    }

    public void setAlgorithms(List<String> algorithms) {
        this.algorithms = algorithms;
    }

    public void setPicture(Picture picture) {
        this.picture = picture;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    public static class Page {

        public Page(int no, int size, SortEnum sort, OrderEnum orderName) {
            this.size = size;
            this.no = no;
            this.sort = sort;
            this.orderName = orderName;
        }

        @XmlElement
        private int size;

        @XmlElement
        private int no;

        @XmlElement
        private SortEnum sort;

        @XmlElement
        private OrderEnum orderName;

        public void setSize(int size) {
            this.size = size;
        }

        public void setNo(int no) {
            this.no = no;
        }

        public void setSort(SortEnum sort) {
            this.sort = sort;
        }

        public void setOrderName(OrderEnum orderName) {
            this.orderName = orderName;
        }
    }

}
